package sample.test{
	import com.takanafu.haruframework.aop.AfterReturningAdvice;
	import com.takanafu.haruframework.aop.MethodBeforeAdvice;
	import com.takanafu.haruframework.aop.ThrowsAdvice;
	import com.takanafu.haruframework.aop.reflect.MethodImpl;
	import com.takanafu.haruframework.aopalliance.reflect.Method;
	import com.takanafu.haruframework.d2l.invoker.MethodInfo;
	
	import mx.collections.ArrayCollection;

	public class LoggingInterceptor implements MethodBeforeAdvice,AfterReturningAdvice,ThrowsAdvice{
		function LoggingInterceptor(){
			trace("LoggingInterceptor:Constructor["+this+"]");
			super();
		}
		
		public function before(m:Method,args:ArrayCollection,target:Object):MethodInfo{
			trace("処理開始:"+m.getName());
			
			return null;
		}
		
		public function afterReturning(returnValue:Object,m:Method,args:ArrayCollection,target:Object):MethodInfo{
			trace("処理終了:"+m.getName());
			
			return null;
		}
		
		public function afterThrowing(m:Method,args:ArrayCollection,target:Object,ex:Error):MethodInfo{
			trace("Exception in method: "+m.getName()+" Exception is: "+ex.message);
			
			return null;
		}
	}
}